const express = require('express')
const router = express.Router()

const expressJoi = require('@escook/express-joi')
const {add_cate_schema,delete_cate_schema,get_cate_schema,update_cate_schema} = require('../schema/artcate')

//导入文章分类的路由处理函数模块
const arctate_handler = require('../router_handler/artcate')

// 获取文章分类的列表数据
router.get('/cates',arctate_handler.getArticleCates)

// 添加文章分类
router.post('/addcates',expressJoi(add_cate_schema),arctate_handler.addArticleCates)

// 删除文章分类
router.get('/deletecate/:id',expressJoi(delete_cate_schema),arctate_handler.deleteCateById)

// 获取文章分类
router.get('/cates/:id',expressJoi(get_cate_schema),arctate_handler.getArtCateById)

// 更新文章分类
router.post('/updatecate',expressJoi(update_cate_schema),arctate_handler.updateCateById)

module.exports = router